package com.tianbo.elfii.client.common;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


import com.tianbo.elfii.client.common.ElfiiCommonUtil.FeedBackType;
import com.tianbo.elfii.client.common.wlanmanagement.BaseDialogPane;


public class NonetTipPane extends BaseDialogPane {

	public Container contentPane = null; 
	public NonetTipDialog dialog = null; 

	public NonetTipPane(int type) {
		super();
		// TODO Auto-generated constructor stub
		
		initNonetTipDialog(type);
		
		dialog.setOpaque(false);
	}
	
	public void init(){
		
	}
	
	public void initNonetTipDialog(int type){
		dialog = new NonetTipDialog(type);
		dialog.setBounds(240, 248, 545, 272);
		dialog.init();
		dialog.confirmBtn.addActionListener(new ConfirmBtnListener());
		dialog.cancelBtn.addActionListener(new CancelBtnListener());
		this.add(dialog);
	}

	public class CancelBtnListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			ElfiiCommonUtil.playFeedbackAudio(FeedBackType.CLICK);
			mainFrame.setContentPane(contentPane);
		}
	}
	
	
	public class ConfirmBtnListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			ElfiiCommonUtil.playFeedbackAudio(FeedBackType.CLICK);
            ElfiiCommonConfigNet configItem = new ElfiiCommonConfigNet();

            configItem.setRunInfo(ElfiiCommonRunInfo.getRunInfo());

            mainFrame.setContentPane(configItem.createViewPanel());

//            mainFrame.getContentPane().add(configItem.createViewPanel(),BorderLayout.CENTER);
            mainFrame.validate();
		}
	}


}
